﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:skin="clr-namespace:UBCon.Ribbon.SkinManagers"
                    xmlns:ubcr="clr-namespace:UBCon.Ribbon">

    <Style x:Key="{x:Type ubcr:RibbonTabItem}" TargetType="{x:Type ubcr:RibbonTabItem}">
        <Style.Triggers>
            <Trigger Property="IsContextual" Value="True">
                <Setter Property="Margin" Value="0"/>
                <Setter Property="Background" Value="{Binding Path=ContextualTabItemsGroup.Brush, RelativeSource={RelativeSource Mode=Self}}"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsMouseOver"  Value="True"/>
                    <Condition Property="IsContextual" Value="True"/>
                </MultiTrigger.Conditions>
                <MultiTrigger.Setters>
                    <Setter Property="Foreground" Value="{Binding Path=ContextualTabItemsGroup.Brush, RelativeSource={RelativeSource Mode=Self}}"/>
                </MultiTrigger.Setters>
            </MultiTrigger>

            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" Value="{DynamicResource ResourceKey={ComponentResourceKey TypeInTargetAssembly={x:Type skin:SkinManager}, ResourceId=WhiteBrush}}" />
                <Setter Property="BorderBrush" Value="{DynamicResource ResourceKey={ComponentResourceKey TypeInTargetAssembly={x:Type skin:SkinManager}, ResourceId=SelectedBorderBrush}}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>